﻿using System;
using System.Threading;

namespace Program14
{
    class Program
    {
         
        static void Main(string[] args)
        {
            Console.WriteLine("主线程");
            Thread t = new Thread(new ThreadStart(ThreadProc));
            t.Start();

            for(var i = 0; i < 4; i++)
            {
                Console.WriteLine("主线程做别的事");
            }
            Console.WriteLine("主线程:要等ThreadProc执行完成");
            t.Join();
        }
        static void ThreadProc()
        {
            for(var i = 0; i < 10; i++)
            {
                Console.WriteLine("ThreadProc:" + i);
                Thread.Sleep(0);
            }
        }
    }
}
